	
	global option    varlabels tex plain fragment bdec(3) se starloc(1) starlevels(10 5 1) noautosumm
	global option_N    varlabels tex plain fragment bdec(3) se starloc(1) starlevels(10 5 1) summstat(N)
	global option_av varlabels tex plain fragment bdec(3)  se nocenter   nostar  noautosumm
	global option_av_N varlabels tex plain fragment bdec(3) se nocenter nostar  summstat(N)
	

 cd  "/Users/eliemurard/Dropbox/Household dissolution and migrants' education/files for replication/"
 
	 use ENDIREH2016_replication.dta,clear 
	 
		
	* sample women not coresiding with partner 
	* either Married or in free union, or Separated or divorced 
	
	
	keep if coresid_husband==0 
	keep if separated==1 | partnered==1
	
	
	global varlist  cores_parents cores_inlaws
	global num : list sizeof global(varlist)

	tempvar samplee
	g `samplee'=1
	
**********************************************************************************	
*	TABLE A.1, APPENDIX  
**********************************************************************************
	
	
	cap drop conss
	g conss=1 
	local j=1
	foreach y of varlist  $varlist conss    {

		nois dis "`y'"
		if "`y'" =="conss"{
		global oav ${option_av_N} 
		global odif ${option_N}  
		}
		if "`y'" !="conss"{
		global oav ${option_av} 
		global odif ${option} 
		}
	
	quietly{ 
		
		local l: variable label `y'
		outreg,clear(b`j') 
		
		cap drop x
		g x= treated==1 & partnered==1 
		label var x  "`l'"
		 reg  `y' x   [aw=fac_muj ]    if x==1 & `samplee'==1  ,nocons 
		outreg, merge(b`j') nod ${oav}   keep(x) ctitle( "", "Direct question - partnered  ")
		
		cap drop x
		g x= recipient ==1 & partnered==1  
		label var x  "`l'"
		 reg  `y' x   [aw=fac_muj ]    if x==1 & `samplee'==1  ,nocons 
		outreg, merge(b`j')  nod   ${oav}  keep(x) ctitle( "", "Remittances - partnered  ")
		
				
		cap drop x
		g x=  treated==1 & separated==1  
		label var x  "`l'"
		 reg  `y'  x    [aw=fac_muj]      if  x==1 & `samplee'==1  ,nocons
		outreg, merge(b`j')  nod    ${oav}  keep(x)   ctitle( "", "Direct question -separated ")
		
		cap drop x
		g x=  recipient ==1 & separated==1
		label var x  "`l'"
		 reg  `y' x   [aw=fac_muj]      if  x==1 & `samplee'==1  ,nocons
		outreg, merge(b`j')  nod    ${oav}  keep(x) ctitle( "", "Remittances -separated")
		
		}		
	local j=`j'+1
	}
	*	
	local a = 1+$num
	forvalues j=1(1)`a'{
		if `j'==1 {	
		qui  outreg , store(main)  replay(b`j')  ${option_av} 
		}
		else{
		qui outreg , store(main) append(b`j') replay(main)  ${option_av} 
		}
		local j=`j'+1
		}

		
	global varlist separated partnered 

	cap drop conss
	g conss=1 
	local j=1
	foreach y of varlist  $varlist  {

		global oav ${option_av} 
		global odif ${option} 
		
		local l: variable label `y'
		outreg,clear(b`j') 
		
		cap drop x
		g x= treated==1 
		label var x  "`l'"
		 reg  `y'  x    [aw=fac_muj]    if  `samplee'==1 &  x==1   ,nocons
		outreg, merge(b`j')  nod    ${oav}  keep(x)   ctitle( "", "Direct question  ")
		
		cap drop x
		g x= recipient==1 
		label var x  "`l'"
		 reg  `y' x   [aw=fac_muj]      if  `samplee'==1  &  x==1  ,nocons
		outreg, merge(b`j')  nod    ${oav}  keep(x) ctitle( "", "Remittances")
		
	local j=`j'+1
	}
	qui  outreg , store(B_main)  replay(b1)  ${option_av} 
	qui outreg , store(B_main) append(b2) replay(B_main)  ${option_av} 
	
	
	 outreg  , replace replay(main)   title(Table A.1: Co-residence patterns with two different definitions of women left behind)
	outreg  , replace replay(B_main) 
	 
